package com.github.pig.common.util;

public class ResponseUtil {
    public static String SUCCESS="200";
    public static String ERROR="500";

    public String status ;
    public String msg;
    public Object data;
    public void ok() {
        this.setStatus("200");
        this.setMsg("成功");
    }

    public void ok(Object data) {
        this.setStatus("200");
        this.setMsg("成功");
        this.setData(data);
    }

    public void ok(String msg, Object data) {
        this.setStatus(SUCCESS);
        this.setMsg(msg);
        this.setData(data);
    }

    public void fail() {
        this.setStatus("500");
        this.setMsg("失败");
    }

    public void fail(String errno, String errmsg) {
        this.setStatus(errno);
        this.setMsg(errmsg);
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }



}

